from selenium import webdriver
from selenium.webdriver.common.by import By
import time
d = webdriver.Chrome()
d.get('https://www.baidu.com')
d.maximize_window()
time.sleep(1)

upload_ele = d.find_element(By.CSS_SELECTOR, '[class="soutu-btn"]')
upload_ele.click()

# 只有 上传的 按钮 是  input 标签的才可以
file_ele = d.find_element(By.CSS_SELECTOR, '[class="upload-pic"]') # 先定位到上传的按钮
file_ele.send_keys(r'')  # 直接 send_keys(r'文件路径')
time.sleep(10)
d.quit()
